package com.laamella.syntherface.synths.alesis.micron.gui;

import com.laamella.syntherface.synths.alesis.micron.model.ModulationMatrix;
import java.awt.Dimension;

public class ModulationMatrixPanel extends javax.swing.JPanel {

    /** Creates new form ModulationMatrixPanel */
    public ModulationMatrixPanel() {
        initComponents();
    }
	
		public void setModel(ModulationMatrix matrix){
		for(int cableNumber=0; cableNumber<ModulationMatrix.PatchCableAmount; cableNumber++){
			ModulationMatrixPatchCablePanel patchCablePanel=new ModulationMatrixPatchCablePanel();
			
			cablePanel.add(patchCablePanel);
			patchCablePanel.setModel(matrix, cableNumber);
			patchCablePanel.setPreferredSize(new Dimension(0, 40));
		}
	}



    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        cablePanel = new javax.swing.JPanel();

        setBackground(new java.awt.Color(204, 255, 0));
        setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(153, 153, 0), 3));
        setLayout(new java.awt.BorderLayout());

        jLabel1.setText("modulationMatrix");
        add(jLabel1, java.awt.BorderLayout.PAGE_START);

        jScrollPane1.setOpaque(false);

        cablePanel.setOpaque(false);
        cablePanel.setLayout(new javax.swing.BoxLayout(cablePanel, javax.swing.BoxLayout.Y_AXIS));
        jScrollPane1.setViewportView(cablePanel);

        add(jScrollPane1, java.awt.BorderLayout.CENTER);
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel cablePanel;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JScrollPane jScrollPane1;
    // End of variables declaration//GEN-END:variables

}
